package com.example.androidshixun;


import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.example.androidshixun.utils.WebViewUtils;

public class ExerciseActivity extends AppCompatActivity {

    private WebView webView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_exercise);
        webView = findViewById(R.id.web_view);
        Intent intent = getIntent();
        String title = intent.getStringExtra("TITLE");
        String url = intent.getStringExtra("URL");
        webView.loadUrl(url);
        TextView titleTv = findViewById(R.id.exercise_title);
        titleTv.setText(title);
        WebViewUtils.setWebViewSettings(webView);
        WebViewUtils.setWebViewClient(webView);

        TextView backTv = findViewById(R.id.exercise_back);
        backTv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

}
